#ifndef __DAEMON_SUB_PROCESS_H__
#define __DAEMON_SUB_PROCESS_H__

#include "sys/types.h"
#define MAX_FAIL_COUNT 5
#define EXE_PATH "/bin/gateway"
//#define EXE_PATH "/home/yinkai/桌面/gateway/gateway_test"
// 被守护的子进程信息结构体
typedef struct {
   pid_t pid;   // 子进程的进程ID
   char *cmd_param;  // 子进程的启动参数
   int fail_count;      // 子进程启动失败的次数
}SubProcess;
// 初始化守护子进程
SubProcess *daemon_sub_process_init(char *cmd_param);

// 启动守护子进程
int daemon_sub_process_start(SubProcess *sp);

// 停止守护子进程
void daemon_sub_process_stop(SubProcess *sp);

#endif /* __DAEMON_SUB_PROCESS_H__ */